package com.yanu.t2s.controller;

import com.yanu.t2s.entity.Pifa;
import com.yanu.t2s.service.PifaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("pifa")
public class PifaController {
    @Autowired
    PifaService pifaService;
    @GetMapping("get/{id_pifa}")
    public Pifa findByIdPifa(@PathVariable int id_pifa) {
        return pifaService.findByIdPifa(id_pifa);
    }
    @GetMapping("get/all")
    public List<Pifa> findAllPifa() {
        return pifaService.findAllPifa();
    }
}
